var events=require('events');
var emitter=events.EventEmitter;
function Dog(name,energy){
    emitter.call(this);
    this.name=name;
    this.energy=energy;
}
Dog.prototype=emitter.prototype;
Dog.prototype.bark=function(){
    console.log(this.name+"barked!"+"energy:"+this.energy);
}
module.exports=Dog;